support DLLs on Windows#75
Draft
jll63 wants to merge 87 commits into
Draft
Conversation
Replace declspec(import/export) approach with method consolidation: - Remove detail::static_fn infrastructure - Revert fn to simple static method member (not via MAKE_STATICS) - In augment_methods(), group methods by type_id and collect overriders from all module copies into canonical method - Build dispatch tables once per unique method, not once per copy This avoids intrusive list manipulation during initialization while enabling correct dispatch table construction with shared method state across DLL boundaries. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
- Resolve deferred type IDs before consolidation (deferred_static_rtti) - Update test_custom_rtti to assign unique IDs to non-polymorphic types via non_polymorphic_static_type<T>() function-local counter, so method tag classes don't collapse to a single sentinel and trigger spurious ambiguous dispatch - Remove get_fn test from dynamic_loading: each module now has its own fn instance, so address equality no longer holds (the state is synchronized via consolidation at initialize time instead) All 77 tests pass. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
- Add `meet` multi-method to test_dynamic_loading so the test exercises multiple methods and non-zero slots/strides — previously the test accidentally passed because the lone `speak` method got slot 0 (matching zero-initialized arrays in non-local module fns) - Rename `canonical_methods` → `local_methods` in augment_methods: the selected method_info isn't canonical in any global sense, it's just the one that happens to live in the module performing initialize() - After dispatch table build, copy slots_strides values from each local method_info to all other module copies. Each module's `fn` has its own slots_strides[] array and dispatch reads it directly, so every copy must hold the same values. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Iterating methods directly and skipping the self pointer is clearer than building a side map keyed by type_index. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Revert from signed int back to std::size_t. To distinguish polymorphic from non-polymorphic types, set the high bit (1 << (sizeof(size_t)*8-1)) in the non_polymorphic_static_type counter values. Polymorphic Animal/ Dog/Cat keep small positive values 1/2/3; method tag classes get values like 0x800...001, 0x800...002 — comfortably outside the 1..3 range used by type_name. Avoids the size mismatch warnings (C4312) that b2's W4/WX flags treat as errors on the int->const-void* reinterpret_cast path. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Policy state moved into registry_state, so stderr_output::os is now a deprecated alias and stream() returns the registry-backed stream. The library's own diagnostics still wrote to os, which broke warnings-as-errors builds (e.g. b2 with /WX). Route them through stream() and give the test's capture_output policy a stream() accessor. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
boost::dll resolves the relative library name against the working directory. Without WORKING_DIRECTORY, ctest ran the test from the binary tree where a stale boost_openmethod-shared.dll could be picked up, failing at load with ERROR_PROC_NOT_FOUND. Point it at $<TARGET_FILE_DIR:boost_openmethod-dynamic>, where the freshly-built DLL sits co-located with the exe. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
An automated preview of the documentation is available at https://75.openmethod.prtest3.cppalliance.org/libs/openmethod/doc/html/index.html If more commits are pushed to the pull request, the docs will rebuild at the same URL. 2026-06-14 16:36:03 UTC |
registry_state::policy<P>() uses the type-indexed std::get<T>(tuple), declared in <tuple>. Newer toolchains pulled the header in transitively, but gcc-12's libstdc++ did not, so only the std::pair overloads of std::get were visible and the call failed to compile. Include <tuple> explicitly in the headers that use std::tuple/std::get. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.